package com.itheima.stock.config;

import com.itheima.stock.cache.Cache;
import com.itheima.stock.cache.impl.RedisCache;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;

/**
 * ClassName: PasswordEncoderConfiguration
 * Package: com.itheima.stock.config
 * Description: Redis 缓存配置类
 *
 * @Author Lee
 * @Create 2024/10/30
 */
@Configuration
public class RedisConfiguration {

    /***
     *
     * @param redisTemplate
     * @return
     */
    @Bean
    public Cache cache(StringRedisTemplate redisTemplate) {

        return new RedisCache(redisTemplate);
    }
}
